<template>
	<view class="container">
		<view class="" style="display: flex;align-items: center;margin-top: 0px;">
			<view class="tag">评分：</view>
			<uni-rate @change="change" :value="current"></uni-rate>
		</view>
		<view class="" style="display: flex;margin-top: 20px;">
			<view class="tag">建议：</view>
			<uni-easyinput v-model="content" type="textarea" placeholder="请输入建议" />
		</view>
		<button type="primary" @click="submit" style="margin-top: 20px;">提交</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content: "",
				current: 0
			};
		},
		onLoad(item) {
			uni.setNavigationBarTitle({
				title: "快递员(张三)"
			})
		},
		onReady() {

		},
		onShow() {

		},
		methods: {
			change(e) {
				console.log(e);
				this.current = e.value
			},
			submit() {
				if (this.current == 0) {
					uni.showToast({
						title: '请评分',
						icon: 'none'
					});
					return
				}
				uni.showToast({
					title: '提交成功',
					icon: 'none'
				});
				setTimeout(function() {
					uni.navigateBack({
						delta: 1
					});
				}, 400);
			}
		}
	};
</script>

<style lang="scss">
	page {
		background-color: white;
	}
</style>
